package org.huntaway.kernel.test;

import com.ice.jni.registry.Registry;
import com.ice.jni.registry.RegistryException;
import com.ice.jni.registry.RegistryKey;
import com.ice.jni.registry.RegistryValue;

public class JNIRegistryExample {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		RegistryKey regkey = Registry.HKEY_LOCAL_MACHINE;
		String str="SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
		RegistryKey key = Registry.openSubkey(regkey, str,//"SOFTWARE\\SMS\\DHC",
				RegistryKey.ACCESS_READ);
		System.out.println(key.getFullName());
		try {
			RegistryValue value = key.getValue("JAVA_HOME");
			String x = new String(value.getByteData());
			System.out.println(x);
		} catch (RegistryException ex) {
			ex.printStackTrace();
		}

	}

}
